<?php

namespace IDock\Insurance\YAIC\Response;

use IDock\Http\Response;
use IDock\Printer\EPolicyDownloadPrinter;

class EPolicyDownloadResponse extends AllYAICResponse
{

    /**
     * @var EPolicyDownloadPrinter $printer
     */
    public $printer = EPolicyDownloadPrinter::class;

    public function printerInit(): Response
    {
        $this->printer = new EPolicyDownloadPrinter();
        $this->printer->data = $this->getBody()['responseBody']['insurancePolicy'] ?? '';
        return $this;
    }
}
